package lab02.test19;

/**
 * Created by 唐苗苗 on 2017/10/26.
 */
public class Test {
    public static void main(String[] args) {
        //输入字符串
        String result="helloword";
        char[] ch=result.toCharArray();
        //从键盘输入数据，构成函数要实例化
        StringBuffer sca=new StringBuffer();
        int i;
        for (i=result.length()-1;i>=0;i--){
            if (ch[i]>='A'&&ch[i]<='z'){
                sca.append(String.valueOf(ch[i]).toLowerCase());
            }else  if (ch[i]>='a'&&ch[i]<='z'){
                sca.append(String.valueOf(ch[i]).toUpperCase());
            }
        }
        System.out.println(sca.toString());
    }
}
